#include <stdio.h>

int main()
{
    //二维数组排序，通过指针，变得异常简单
    //当作一维数组排序就好了
    //数的大小不能大于255
    
    char a[2][5] = {{32,121,3,123,21}, {31,31,91,12,21}};
    char *p = (char *)a;

    int i, j;
    for(i = 0; i < 10; i++)
    {
        for(j = 1; j < 10 - i; j++)
        {
            if(p[j] < p[j - 1])
            {
                char tmp = p[j];
                p[j] = p[j - 1];
                p[j - 1] = tmp;
            }
        }
    }

    for(i = 0; i < 2; i++)
    {
        for(j = 0; j < 5; j++)
        {
            printf("%d\n", a[i][j]);
        }
    }


    return 0;
}

